package com.bidepan.特殊类型注入;

import java.util.List;

public class Dept {
    //一个部门包含多个员工
    private List<Emp> empList;
    private String Dname;
    public void info(){
        System.out.println("部门名称："+Dname);
        System.out.println("在该部门工作的员工有：");
        if(empList.isEmpty()){
            return;
        }
        for(Emp emp:empList){
            System.out.println(emp.toString());
        }
    }

    public void setEmpList(List<Emp> empList) {
        this.empList = empList;
    }

    public void setDname(String dname) {
        Dname = dname;
    }

    public List<Emp> getEmpList() {
        return empList;
    }

    public String getDname() {
        return Dname;
    }
}
